package com.hmy.finance.job.core.rdto.dailyfee;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * The contract Daily Fee Bill Generate Process Return Data Transfer Object.
 *
 * @author songkf
 */
@Data
public class DailyFeeBillGenerateProcessRdto implements Serializable {
    private static final long serialVersionUID = -8595667018913416003L;

    /**
     * The Contract ID
     */
    private Long contractId;
    /**
     * Bill Through Date
     */
    private LocalDate billThroughDate;

    /**
     * Process Result
     */
    private Boolean processResult;

    public Boolean isSuccess() {
        return processResult;
    }

    public static DailyFeeBillGenerateProcessRdto success(Long contractId, LocalDate billThroughDate) {
        DailyFeeBillGenerateProcessRdto rdto = new DailyFeeBillGenerateProcessRdto();
        rdto.setContractId(contractId);
        rdto.setBillThroughDate(billThroughDate);
        rdto.setProcessResult(Boolean.TRUE);
        return rdto;
    }

    public static DailyFeeBillGenerateProcessRdto fail(Long contractId) {
        DailyFeeBillGenerateProcessRdto rdto = new DailyFeeBillGenerateProcessRdto();
        rdto.setContractId(contractId);
        rdto.setProcessResult(Boolean.FALSE);
        return rdto;
    }
}
